<template>
    <!-- 标题区域 -->
    <van-nav-bar title="商品详情" left-text="返回" left-arrow @click-left="() => { $router.push('/') }" fixed />
    <div style="height: 45px;"></div>
    <!-- v-html -->
    <div v-html="detailData.goods_introduce">

    </div>
    <!-- 动作栏 -->
    <van-action-bar>
        <van-action-bar-icon icon="chat-o" text="客服" @click="onClickIcon" />
        <van-action-bar-icon icon="cart-o" text="购物车" @click="onClickIcon" />
        <van-action-bar-icon icon="shop-o" text="店铺" @click="onClickIcon" />
        <van-action-bar-button type="danger" text="立即购买" @click="onClickButton" />
    </van-action-bar>
</template>

<script setup>
// 引入ref
import { ref } from 'vue'
// 获取路由中传递的参数
import { useRoute } from 'vue-router'
const route = useRoute()
console.log('路由参数', route.params.goods_id)
// 引入详情
import { detailApi } from '@/api/api'
// 自定义详情数据
let detailData = ref([])
detailApi(route.params.goods_id).then(res => {
    console.log('详情数据', res)
    detailData.value = res.data.message
})
</script>

<style lang="scss" scoped></style>    